<%-- 
    Document   : create-book
    Created on : 24.4.2011, 17:30:55
    Author     : mantaex
--%>

<%@page import="java.util.Map"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% 
Map bookValues = (Map) session.getAttribute("book-values");
%>

<!doctype html>

<html lang="cs">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" type="text/css" href="shared/style.css" />
        <title>Vytváření knihy</title>
    </head>
    <body>
       <h1>jLibrarian</h1>
       <div id="main">
           <div id="menu">
                 <div class="group">
                    <h3>Zákazníci</h3>
                    <ul>
                        <li><a href="customer-create.jsp">Nový zákazník</a></li>
                        <li><a href="customer-list.jsp">Zobrazit zákazníky</a></li>
                    </ul>
                 </div>
                <div class="group">
                    <h3>Knihy</h3>
                    <ul>
                        <li><a class="active" href="book-create.jsp">Nová kniha</a></li>
                        <li><a href="book-list.jsp">Zobrazit knihy</a></li>
                    </ul>
                 </div>
           </div>
           <div id="content">
                <!-- start of the content -->
                
                <h2>Nová kniha</h2>
                
                <!-- start of the messages -->
                <% if(session != null) out.print(session.getAttribute("messages")); %>
                <% session.setAttribute("messages", ""); %>
                <!-- start of the messages -->
                
                <form action="${pageContext.request.contextPath}/CreateBookServlet" method="post">                    
                    <div class="form-item">
                        <label for="title">Název:</label>
                        <input type="text" class="long" value="<% if(bookValues != null) out.print(bookValues.get("title")); %>" name="title" />
                    </div>                    
                    <div class="form-item">
                        <label for="authors">Autor:</label>
                        <input type="text" class="long" value="<% if(bookValues != null) out.print(bookValues.get("authors")); %>" name="authors" />
                    </div>                    
                    <div class="form-item">
                        <label for="quantity">Počet výtisků:</label>
                        <input type="text" class="short" value="<% if(bookValues != null) out.print(bookValues.get("quantity")); %>" name="quantity" />
                    </div>                
                    <div class="form-item">
                        <label for="note">Poznámka:</label>
                        <textarea name="note"><% if(bookValues != null) out.print(bookValues.get("note")); %></textarea>
                    </div>   
                    <div class="form-buttons">
                        <input type="submit" value="Uložit" />
                    </div>
                </form>
                
                <!-- end of the content -->
           </div>
       </div>
  </body>
</html>

